package com.luzhikun.Listener.servletContextListener;

import javax.servlet.ServletContextAttributeEvent;
import javax.servlet.ServletContextAttributeListener;

/**
 * @Author Rookie Coder
 * @Description
 * @Date
 **/
public class ServletContextAttributeLister implements ServletContextAttributeListener {

    // 监听向ServletContext域中添加数据的时候执行
    @Override
    public void attributeAdded(ServletContextAttributeEvent event) {
        System.out.println("数据被添加了");
    }

    // 监听向ServletContext域中删除数据的时候执行
    @Override
    public void attributeRemoved(ServletContextAttributeEvent event) {
        System.out.println("数据被删除了");
    }

    // 监听向ServletContext域中修改数据的时候执行
    @Override
    public void attributeReplaced(ServletContextAttributeEvent event) {
        System.out.println("数据被修改了");
    }
}
